﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Presentation.Web.Admin.Areas.Open.Controllers
{
    public class TourController : Infrastructure.Crosscutting.NetFramework.Controllers.OpenBaseController
    {
        Application.Admin.Tour.IOpenTourService openTourService;

        public TourController(Application.Admin.Tour.IOpenTourService openTour)
        {
            if (openTour == null)
            {
                throw new ArgumentNullException("openTourService is null");
            }
            openTourService = openTour;
        }

        public JsonResult GetAllTour()
        {
            var data = openTourService.GetAllTour();
            if (data == null)
            {
                return Json("", JsonRequestBehavior.AllowGet);
            }
            return Json(data, JsonRequestBehavior.AllowGet);
        }

        public JsonResult GetTourDetail(int id)
        {
            var data = openTourService.GetTourDetailByTourId(id);
            if (data == null)
            {
                return Json("", JsonRequestBehavior.AllowGet);
            }
            return Json(data, JsonRequestBehavior.AllowGet);
        }
    }
}
